/*
 * Rectangle.cpp
 *
 *  Created on: 27 janv. 2010
 *      Author: id2856
 */

#include "Rectangle.h"



Rectangle::Rectangle(wxWindow * parent,wxColor* col) : Dessin(parent,col){}



void Rectangle::OnPaint(wxPaintEvent& event){
        wxPaintDC dc (this);
        dc.SetPen(wxPen(GetForegroundColour()));
        dc.SetBrush(wxBrush(GetForegroundColour()));
        dc.DrawRectangle(0,0,(int) Dessin::GetSize().GetWidth(),(int) Dessin::GetSize().GetHeight());
        //std::cout<<"x1= " <<x1<<"y1= " <<y1<<"x2= " <<x2<<"y2= " <<y2<<std::endl;
}

void  Rectangle::paintMeLikeYou(wxWindow* window){
 wxPaintDC dc (window);
        dc.SetPen(wxPen(GetForegroundColour()));
        dc.SetBrush(wxBrush(GetForegroundColour()));
        dc.DrawRectangle(0,0,(int) window->GetSize().GetWidth(),(int) window->GetSize().GetHeight());
}

/*
Dessin* Rectangle::disconnectedCopy(){
    Dessin* copie = new Rectangle(*((Rectangle*) this));
    copie->Disconnect(wxEVT_PAINT, wxPaintEventHandler(Dessin::OnPaint)) ;
    copie->Disconnect(wxEVT_SIZE, wxSizeEventHandler (Dessin::OnSize)) ;
    copie->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(Dessin::OnMousePressed)) ;
    copie->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(Dessin::OnRelease)) ;
    copie->Disconnect(wxEVT_MOTION ,wxMouseEventHandler (Dessin::OnMotion)) ;
}
*/



